﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ProgramMain.OpticNet
{
    public partial class FrmFibrePointDetail : ProgramMain.Framework.frmBase
    {
        public FrmFibrePointDetail()
        {
            InitializeComponent();
        }


        public int VertexID
        {
            get { return fibrePointDetail.VertexID; }
            set
            {
                fibrePointDetail.VertexID = value;
                fibrePointList.VertexID = value;
            }
        }
        public string VertexName
        {
            set { fibrePointDetail.VertexName =  value; }
        }
        
        public int? EquipVertexID
        {
            get { return fibrePointDetail.DetailID; }
            set { fibrePointDetail.DetailID = value; }
        }

        public DialogResult ShowForm()
        {
            fibrePointDetail.DBRead();
            return  this.ShowDialog(Program.MainForm);
        }

        private void FrmFibrePointDetail_Load(object sender, EventArgs e)
        {
            if (fibrePointDetail.AddFibrePoint == null)
                fibrePointDetail.AddFibrePoint = fibrePointList.AddFibrePoint;
            fibrePointList.AfterDeleteFibrePoint += fibrePointDetail.OnLoadData;
        }

        private void fibrePointDetail_ViewRowIDChanged(object sender, Framework.BaseDetailCtl.ShowDetailEventArgs e)
        {
            fibrePointList.DetailID = e.DetailID;
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
        }


    }
}
